import http.client
import sys

try:
    conn = http.client.HTTPConnection("localhost:8001")
    conn.request("GET", "/health")
    response = conn.getresponse()
    
    if response.status == 200:
        sys.exit(0)  # 健康检查成功
    else:
        sys.exit(1)  # 健康检查失败
except Exception as e:
    sys.exit(1)  # 发生异常时健康检查失败